package ru.usu.gv.utils.generators;

import javax.swing.JPanel;

import ru.usu.gv.core.I18nService;
import ru.usu.gv.graph.Graph;
import ru.usu.gv.gui.component.GVIntegerField;
import ru.usu.gv.utils.RandomUtilities;

/**
 @author Sergey Pupyrev 
 14.05.2007
 */

public class MobiusGenerator extends GraphGeneratorBase
{
    public String getTitle()
    {
        return I18nService.get("generator.mobius");
    }

    public Graph generate(JPanel panel)
    {
        GVIntegerField width = (GVIntegerField)panel.getComponent(0);
        GVIntegerField height = (GVIntegerField)panel.getComponent(1);

        return RandomUtilities.generateMebGraph(width.getValue(), height.getValue());
    }

    @Override
    public void customizePanel(JPanel panel)
    {
        super.customizePanel(panel);

        GVIntegerField width = new GVIntegerField(I18nService.get("generator.mobius.width"), 6, true);
        GVIntegerField height = new GVIntegerField(I18nService.get("generator.mobius.length"), 30, true);

        panel.add(width);
        panel.add(height);

        //israndom
    }

}
